{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 85,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>ID</th>\n",
       "      <th>LIMIT_BAL</th>\n",
       "      <th>SEX</th>\n",
       "      <th>EDUCATION</th>\n",
       "      <th>MARRIAGE</th>\n",
       "      <th>AGE</th>\n",
       "      <th>PAY_0</th>\n",
       "      <th>PAY_2</th>\n",
       "      <th>PAY_3</th>\n",
       "      <th>PAY_4</th>\n",
       "      <th>...</th>\n",
       "      <th>BILL_AMT4</th>\n",
       "      <th>BILL_AMT5</th>\n",
       "      <th>BILL_AMT6</th>\n",
       "      <th>PAY_AMT1</th>\n",
       "      <th>PAY_AMT2</th>\n",
       "      <th>PAY_AMT3</th>\n",
       "      <th>PAY_AMT4</th>\n",
       "      <th>PAY_AMT5</th>\n",
       "      <th>PAY_AMT6</th>\n",
       "      <th>default.payment.next.month</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>20000.0</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>24</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>-1</td>\n",
       "      <td>-1</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>689.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>120000.0</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>26</td>\n",
       "      <td>-1</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>3272.0</td>\n",
       "      <td>3455.0</td>\n",
       "      <td>3261.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1000.0</td>\n",
       "      <td>1000.0</td>\n",
       "      <td>1000.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2000.0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3</td>\n",
       "      <td>90000.0</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>34</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>14331.0</td>\n",
       "      <td>14948.0</td>\n",
       "      <td>15549.0</td>\n",
       "      <td>1518.0</td>\n",
       "      <td>1500.0</td>\n",
       "      <td>1000.0</td>\n",
       "      <td>1000.0</td>\n",
       "      <td>1000.0</td>\n",
       "      <td>5000.0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4</td>\n",
       "      <td>50000.0</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>37</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>28314.0</td>\n",
       "      <td>28959.0</td>\n",
       "      <td>29547.0</td>\n",
       "      <td>2000.0</td>\n",
       "      <td>2019.0</td>\n",
       "      <td>1200.0</td>\n",
       "      <td>1100.0</td>\n",
       "      <td>1069.0</td>\n",
       "      <td>1000.0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5</td>\n",
       "      <td>50000.0</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>57</td>\n",
       "      <td>-1</td>\n",
       "      <td>0</td>\n",
       "      <td>-1</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>20940.0</td>\n",
       "      <td>19146.0</td>\n",
       "      <td>19131.0</td>\n",
       "      <td>2000.0</td>\n",
       "      <td>36681.0</td>\n",
       "      <td>10000.0</td>\n",
       "      <td>9000.0</td>\n",
       "      <td>689.0</td>\n",
       "      <td>679.0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 25 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "   ID  LIMIT_BAL  SEX  EDUCATION  MARRIAGE  AGE  PAY_0  PAY_2  PAY_3  PAY_4  \\\n",
       "0   1    20000.0    2          2         1   24      2      2     -1     -1   \n",
       "1   2   120000.0    2          2         2   26     -1      2      0      0   \n",
       "2   3    90000.0    2          2         2   34      0      0      0      0   \n",
       "3   4    50000.0    2          2         1   37      0      0      0      0   \n",
       "4   5    50000.0    1          2         1   57     -1      0     -1      0   \n",
       "\n",
       "              ...              BILL_AMT4  BILL_AMT5  BILL_AMT6  PAY_AMT1  \\\n",
       "0             ...                    0.0        0.0        0.0       0.0   \n",
       "1             ...                 3272.0     3455.0     3261.0       0.0   \n",
       "2             ...                14331.0    14948.0    15549.0    1518.0   \n",
       "3             ...                28314.0    28959.0    29547.0    2000.0   \n",
       "4             ...                20940.0    19146.0    19131.0    2000.0   \n",
       "\n",
       "   PAY_AMT2  PAY_AMT3  PAY_AMT4  PAY_AMT5  PAY_AMT6  \\\n",
       "0     689.0       0.0       0.0       0.0       0.0   \n",
       "1    1000.0    1000.0    1000.0       0.0    2000.0   \n",
       "2    1500.0    1000.0    1000.0    1000.0    5000.0   \n",
       "3    2019.0    1200.0    1100.0    1069.0    1000.0   \n",
       "4   36681.0   10000.0    9000.0     689.0     679.0   \n",
       "\n",
       "   default.payment.next.month  \n",
       "0                           1  \n",
       "1                           1  \n",
       "2                           0  \n",
       "3                           0  \n",
       "4                           0  \n",
       "\n",
       "[5 rows x 25 columns]"
      ]
     },
     "execution_count": 85,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import pandas as pd\n",
    "import sklearn\n",
    "import numpy as np\n",
    "\n",
    "credit=pd.read_csv(\"Credit.csv\")\n",
    "credit.head(5)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 86,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "#We don't need the ID column,so lets drop it.\n",
    "credit = credit.drop([\"ID\"],axis=1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 87,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "#changing the name of  pay_0 column to pay_1 to make the numbering correct"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 88,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "credit.rename(columns={'PAY_0':'PAY_1'}, inplace=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 89,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>LIMIT_BAL</th>\n",
       "      <th>SEX</th>\n",
       "      <th>EDUCATION</th>\n",
       "      <th>MARRIAGE</th>\n",
       "      <th>AGE</th>\n",
       "      <th>PAY_1</th>\n",
       "      <th>PAY_2</th>\n",
       "      <th>PAY_3</th>\n",
       "      <th>PAY_4</th>\n",
       "      <th>PAY_5</th>\n",
       "      <th>...</th>\n",
       "      <th>BILL_AMT4</th>\n",
       "      <th>BILL_AMT5</th>\n",
       "      <th>BILL_AMT6</th>\n",
       "      <th>PAY_AMT1</th>\n",
       "      <th>PAY_AMT2</th>\n",
       "      <th>PAY_AMT3</th>\n",
       "      <th>PAY_AMT4</th>\n",
       "      <th>PAY_AMT5</th>\n",
       "      <th>PAY_AMT6</th>\n",
       "      <th>default.payment.next.month</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>20000.0</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>24</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>-1</td>\n",
       "      <td>-1</td>\n",
       "      <td>-2</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>689.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>1 rows × 24 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "   LIMIT_BAL  SEX  EDUCATION  MARRIAGE  AGE  PAY_1  PAY_2  PAY_3  PAY_4  \\\n",
       "0    20000.0    2          2         1   24      2      2     -1     -1   \n",
       "\n",
       "   PAY_5             ...              BILL_AMT4  BILL_AMT5  BILL_AMT6  \\\n",
       "0     -2             ...                    0.0        0.0        0.0   \n",
       "\n",
       "   PAY_AMT1  PAY_AMT2  PAY_AMT3  PAY_AMT4  PAY_AMT5  PAY_AMT6  \\\n",
       "0       0.0     689.0       0.0       0.0       0.0       0.0   \n",
       "\n",
       "   default.payment.next.month  \n",
       "0                           1  \n",
       "\n",
       "[1 rows x 24 columns]"
      ]
     },
     "execution_count": 89,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "credit.head(1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 90,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2    14030\n",
       "1    10585\n",
       "3     4917\n",
       "5      280\n",
       "4      123\n",
       "6       51\n",
       "0       14\n",
       "Name: EDUCATION, dtype: int64"
      ]
     },
     "execution_count": 90,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#Removing Unwanted categorical levels as mentioned in data exploration\n",
    "credit['EDUCATION'].value_counts()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 91,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "#Changing Education levels 0,5,6 to others(4)\n",
    "credit[\"EDUCATION\"]=credit[\"EDUCATION\"].map({0:4,1:1,2:2,3:3,4:4,5:4,6:4})"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 92,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2    14030\n",
       "1    10585\n",
       "3     4917\n",
       "4      468\n",
       "Name: EDUCATION, dtype: int64"
      ]
     },
     "execution_count": 92,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "credit['EDUCATION'].value_counts()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 93,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2    15964\n",
       "1    13659\n",
       "3      323\n",
       "0       54\n",
       "Name: MARRIAGE, dtype: int64"
      ]
     },
     "execution_count": 93,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "credit['MARRIAGE'].value_counts()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 94,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "#similarly chaning marriage level 0 to level 3\n",
    "credit[\"MARRIAGE\"]=credit[\"MARRIAGE\"].map({0:3,1:1,2:2,3:3})"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 95,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2    15964\n",
       "1    13659\n",
       "3      377\n",
       "Name: MARRIAGE, dtype: int64"
      ]
     },
     "execution_count": 95,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "credit['MARRIAGE'].value_counts()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 96,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ 0.06673129,  0.01107916,  0.03071698,  0.01828816,  0.06729232,\n",
       "        0.10502206,  0.04590552,  0.03639505,  0.02706571,  0.02889421,\n",
       "        0.02720425,  0.05080295,  0.04753515,  0.04445718,  0.04384626,\n",
       "        0.04408402,  0.04320006,  0.04511946,  0.042764  ,  0.04264839,\n",
       "        0.04227342,  0.04214917,  0.04652524])"
      ]
     },
     "execution_count": 96,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#lets check which features are important\n",
    "from sklearn.ensemble import ExtraTreesClassifier\n",
    "from sklearn.datasets import load_iris\n",
    "from sklearn.feature_selection import SelectFromModel\n",
    "X = credit.drop('default.payment.next.month',axis=1)\n",
    "Y = credit['default.payment.next.month']\n",
    "clf = ExtraTreesClassifier()\n",
    "clf = clf.fit(X, Y)\n",
    "clf.feature_importances_"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 97,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "#Feature Scaling"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 98,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.axes._subplots.AxesSubplot at 0x21fe2edd5c0>"
      ]
     },
     "execution_count": 98,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAY4AAAD8CAYAAABgmUMCAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAGP5JREFUeJzt3XGQVed53/HvD7BYLEIAy72zZZkKzzDuADOWzQ7FcZK5\nGDlsXI1R/9GsHUckoaJTqGun1SRQ/+HmD2aUhHZsxhX2ju1oqYXIRpECowmxCdWdtDNFGGzFCCTK\nWhiLLQJHjkxXrajBT/+4r8rZuxftfeHu3T2r32fmzH3Pc9737nn2SPfhvOecu4oIzMzMWjVrqnfA\nzMzKxYXDzMyyuHCYmVkWFw4zM8viwmFmZllcOMzMLIsLh5mZZXHhMDOzLC4cZmaWZc5U78BE7rrr\nrrj77rvHxd944w3uvPPOzu/QJJuJec3EnMB5lc07La8TJ078XUS8d1J+aERMuAC/C5wCXgCeALqA\nxcBh4Gx6XVTovwMYBs4AGwrx1cDJtG03oIl+9urVq6OZZ599tmm87GZiXjMxpwjnVTbvtLyA49HC\n5/utLBNOVUlaAvxroDciVgGzgX5gO3AkIpYDR9I6klak7SuBPuBRSbPT2+0BHgKWp6Xv1sqdmZlN\nlVavccwB5kmaA7wb+J/ARmAwbR8E7k/tjcD+iLgaEeeon12skdQNLIiIo6ka7i2MMTOzkpjwGkdE\njEjaBfwI+D/AtyPi25IqEXExdXsVqKT2EuBo4S0upNjPUrsxPo6kLcAWgEqlQq1WG9dndHS0abzs\nZmJeMzEncF5l47zaZ8LCIWkR9bOIZcDrwJ9J+nSxT0SEpLZ9P3tEDAADAL29vVGtVsf1qdVqNIuX\n3UzMaybmBM6rbJxX+7QyVXUvcC4ifhwRPwOeAn4JuJSmn0ivl1P/EWBpYXxPio2kdm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ehvhKxl4QepmbXxD6eIpv\nY+wFoaHUXkx9zndRWs4Bi9O2P2PsBaGtU/i7mJPyXMaNi+Mrp2p/CvslYC/wxYb4HzP2Yt4fdfLY\ntTnHKjeucZQ+L+C/Au9P7X+fciptXtS/PfsU8O60L4PAZ0qe092MvcYxpblwC5+FU/mhNEx9zu35\ntHylsO3z1O8gOEO6WyDFe4EX0rYvc+MBxq6U/HD6hb6vMOZ3UnwY+O1C/H2p73AaO3eqfhdpfz5O\n/a6lHwCfn8p9KezTL1M/bf5+4Th9nPq86BHgLPDXxf+ZOnHs2pxjlRuFo/R5AfcAx9Mx+4v0IVHq\nvIA/AF5K+/OfqX+QljIn4Anq12p+Rv0McfNU58ItfBb6yXEzM8syXe6qMjOzknDhMDOzLC4cZmaW\nxYXDzMyyuHCYmVkWFw4zM8viwmFmZllcOMzMLMv/A7Nn7tH+fyBlAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x21fe2ed1518>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "%matplotlib inline\n",
    "#feature scaling check\n",
    "credit['BILL_AMT1'].hist(bins=60, color='orange')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 99,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 0.01010101,  1.        ,  0.33333333, ...,  0.        ,\n",
       "         0.        ,  1.        ],\n",
       "       [ 0.11111111,  1.        ,  0.33333333, ...,  0.        ,\n",
       "         0.00378311,  1.        ],\n",
       "       [ 0.08080808,  1.        ,  0.33333333, ...,  0.00234451,\n",
       "         0.00945777,  0.        ],\n",
       "       ..., \n",
       "       [ 0.02020202,  0.        ,  0.33333333, ...,  0.00468901,\n",
       "         0.00586382,  1.        ],\n",
       "       [ 0.07070707,  0.        ,  0.66666667, ...,  0.12417444,\n",
       "         0.00341236,  1.        ],\n",
       "       [ 0.04040404,  0.        ,  0.33333333, ...,  0.00234451,\n",
       "         0.00189155,  1.        ]])"
      ]
     },
     "execution_count": 99,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from sklearn.preprocessing import MinMaxScaler\n",
    "\n",
    "scaler = MinMaxScaler()\n",
    "scaler.fit_transform(credit)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 100,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "LIMIT_BAL                     0\n",
       "SEX                           0\n",
       "EDUCATION                     0\n",
       "MARRIAGE                      0\n",
       "AGE                           0\n",
       "PAY_1                         0\n",
       "PAY_2                         0\n",
       "PAY_3                         0\n",
       "PAY_4                         0\n",
       "PAY_5                         0\n",
       "PAY_6                         0\n",
       "BILL_AMT1                     0\n",
       "BILL_AMT2                     0\n",
       "BILL_AMT3                     0\n",
       "BILL_AMT4                     0\n",
       "BILL_AMT5                     0\n",
       "BILL_AMT6                     0\n",
       "PAY_AMT1                      0\n",
       "PAY_AMT2                      0\n",
       "PAY_AMT3                      0\n",
       "PAY_AMT4                      0\n",
       "PAY_AMT5                      0\n",
       "PAY_AMT6                      0\n",
       "default.payment.next.month    0\n",
       "dtype: int64"
      ]
     },
     "execution_count": 100,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#check for null values\n",
    "credit.apply(lambda x: sum(x.isnull()),axis=0) "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 101,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "#Initial Model training(except feed forward neural network)\n",
    "from sklearn.model_selection import train_test_split\n",
    "\n",
    "train, test = train_test_split(credit, test_size = 0.3)\n",
    "\n",
    "X_train = train.drop('default.payment.next.month',axis=1)\n",
    "\n",
    "y_train = train['default.payment.next.month']\n",
    "\n",
    "X_test =  test.drop('default.payment.next.month',axis=1)\n",
    "\n",
    "y_test = test['default.payment.next.month']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 102,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "LogisticRegression(C=1.0, class_weight=None, dual=False, fit_intercept=True,\n",
       "          intercept_scaling=1, max_iter=100, multi_class='ovr', n_jobs=1,\n",
       "          penalty='l2', random_state=10, solver='liblinear', tol=0.0001,\n",
       "          verbose=0, warm_start=False)"
      ]
     },
     "execution_count": 102,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#Train benchmark model(Log Regression)\n",
    "from sklearn.linear_model import LogisticRegression\n",
    "clf0 = LogisticRegression(random_state=10)\n",
    "clf0.fit(X_train, y_train)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 103,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "accuracy: 0.777\n",
      "Precision: 0.603729\n",
      "Recall: 0.777\n",
      "f1_score: 0.679492402926\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\sklearn\\metrics\\classification.py:1135: UndefinedMetricWarning: Precision is ill-defined and being set to 0.0 in labels with no predicted samples.\n",
      "  'precision', 'predicted', average, warn_for)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\sklearn\\metrics\\classification.py:1135: UndefinedMetricWarning: F-score is ill-defined and being set to 0.0 in labels with no predicted samples.\n",
      "  'precision', 'predicted', average, warn_for)\n"
     ]
    }
   ],
   "source": [
    "from sklearn.metrics import accuracy_score\n",
    "from sklearn.metrics import recall_score\n",
    "from sklearn.metrics import precision_score\n",
    "from sklearn.metrics import f1_score\n",
    "y_pred = clf0.predict(X_test)\n",
    "accuracy_regr=accuracy_score(y_test, y_pred)\n",
    "precision_regr=precision_score(y_test, y_pred,average='weighted')\n",
    "recall_regr=recall_score(y_test, y_pred,average='weighted')\n",
    "f1_regr=f1_score(y_test,y_pred,average='weighted')\n",
    "print(\"accuracy:\", accuracy_regr)\n",
    "print(\"Precision:\", precision_regr)\n",
    "print(\"Recall:\", recall_regr)\n",
    "print('f1_score:',f1_regr)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 104,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "RandomForestClassifier(bootstrap=True, class_weight=None, criterion='gini',\n",
       "            max_depth=None, max_features='auto', max_leaf_nodes=None,\n",
       "            min_impurity_decrease=0.0, min_impurity_split=None,\n",
       "            min_samples_leaf=1, min_samples_split=2,\n",
       "            min_weight_fraction_leaf=0.0, n_estimators=10, n_jobs=1,\n",
       "            oob_score=False, random_state=10, verbose=0, warm_start=False)"
      ]
     },
     "execution_count": 104,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#Train other classifiers\n",
    "#We start with randomforest\n",
    "from sklearn.ensemble import RandomForestClassifier\n",
    "clf1=RandomForestClassifier(random_state=10)\n",
    "clf1.fit(X_train,y_train)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 105,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "accuracy: 0.807222222222\n",
      "Precision: 0.785871777618\n",
      "Recall: 0.807222222222\n",
      "f1_score: 0.783502576417\n"
     ]
    }
   ],
   "source": [
    "y_pred1 = clf1.predict(X_test)\n",
    "accuracy_rf=accuracy_score(y_test, y_pred1)\n",
    "precision_rf=precision_score(y_test, y_pred1,average='weighted')\n",
    "recall_rf=recall_score(y_test, y_pred1,average='weighted')\n",
    "f1_rf=f1_score(y_test,y_pred1,average='weighted')\n",
    "print(\"accuracy:\", accuracy_rf)\n",
    "print(\"Precision:\", precision_rf)\n",
    "print(\"Recall:\", recall_rf)\n",
    "print('f1_score:',f1_rf)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 106,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "GradientBoostingClassifier(criterion='friedman_mse', init=None,\n",
       "              learning_rate=0.1, loss='deviance', max_depth=3,\n",
       "              max_features=None, max_leaf_nodes=None,\n",
       "              min_impurity_decrease=0.0, min_impurity_split=None,\n",
       "              min_samples_leaf=1, min_samples_split=2,\n",
       "              min_weight_fraction_leaf=0.0, n_estimators=100,\n",
       "              presort='auto', random_state=10, subsample=1.0, verbose=0,\n",
       "              warm_start=False)"
      ]
     },
     "execution_count": 106,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#gradeint boost\n",
    "from sklearn.ensemble import GradientBoostingClassifier\n",
    "clf2=GradientBoostingClassifier(random_state=10)\n",
    "clf2.fit(X_train,y_train)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 107,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "accuracy: 0.821444444444\n",
      "Precision: 0.805451059511\n",
      "Recall: 0.821444444444\n",
      "f1_score: 0.800503291948\n"
     ]
    }
   ],
   "source": [
    "y_pred2 = clf2.predict(X_test)\n",
    "accuracy_gb=accuracy_score(y_test, y_pred2)\n",
    "precision_gb=precision_score(y_test, y_pred2,average='weighted')\n",
    "recall_gb=recall_score(y_test, y_pred2,average='weighted')\n",
    "f1_gb=f1_score(y_test,y_pred2,average='weighted')\n",
    "print(\"accuracy:\", accuracy_gb)\n",
    "print(\"Precision:\", precision_gb)\n",
    "print(\"Recall:\", recall_gb)\n",
    "print('f1_score:',f1_gb)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 108,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "AdaBoostClassifier(algorithm='SAMME.R', base_estimator=None,\n",
       "          learning_rate=1.0, n_estimators=50, random_state=10)"
      ]
     },
     "execution_count": 108,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#adaboost\n",
    "from sklearn.ensemble import AdaBoostClassifier\n",
    "clf3 = AdaBoostClassifier(random_state=10)\n",
    "clf3.fit(X_train, y_train)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 109,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "accuracy: 0.818555555556\n",
      "Precision: 0.802242885074\n",
      "Recall: 0.818555555556\n",
      "f1_score: 0.793428250173\n"
     ]
    }
   ],
   "source": [
    "y_pred3 = clf3.predict(X_test)\n",
    "accuracy_ab=accuracy_score(y_test, y_pred3)\n",
    "precision_ab=precision_score(y_test, y_pred3,average='weighted')\n",
    "recall_ab=recall_score(y_test, y_pred3,average='weighted')\n",
    "f1_ab=f1_score(y_test,y_pred3,average='weighted')\n",
    "print(\"accuracy:\", accuracy_ab)\n",
    "print(\"Precision:\", precision_ab)\n",
    "print(\"Recall:\", recall_ab)\n",
    "print('f1_score:',f1_ab)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 110,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "VotingClassifier(estimators=[('rf', RandomForestClassifier(bootstrap=True, class_weight=None, criterion='gini',\n",
       "            max_depth=None, max_features='auto', max_leaf_nodes=None,\n",
       "            min_impurity_decrease=0.0, min_impurity_split=None,\n",
       "            min_samples_leaf=1, min_samples_split=2,\n",
       "            min_we...thm='SAMME.R', base_estimator=None,\n",
       "          learning_rate=1.0, n_estimators=50, random_state=10))],\n",
       "         flatten_transform=None, n_jobs=1, voting='hard', weights=None)"
      ]
     },
     "execution_count": 110,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#voting classifier\n",
    "from sklearn.ensemble import VotingClassifier\n",
    "clf4 = VotingClassifier(estimators=[('rf',clf1),('gb', clf2),('ab',clf3)])\n",
    "clf4.fit(X_train,y_train)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 111,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "accuracy: 0.819777777778\n",
      "Precision: 0.803495820308\n",
      "Recall: 0.819777777778\n",
      "f1_score: 0.79663926916\n"
     ]
    }
   ],
   "source": [
    "y_pred4 = clf4.predict(X_test)\n",
    "accuracy_vc=accuracy_score(y_test, y_pred4)\n",
    "precision_vc=precision_score(y_test, y_pred4,average='weighted')\n",
    "recall_vc=recall_score(y_test, y_pred4,average='weighted')\n",
    "f1_vc=f1_score(y_test,y_pred4,average='weighted')\n",
    "print(\"accuracy:\", accuracy_vc)\n",
    "print(\"Precision:\", precision_vc)\n",
    "print(\"Recall:\", recall_vc)\n",
    "print('f1_score:',f1_vc)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 112,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "#appending all socres\n",
    "arraycuracy=[]\n",
    "arraycuracy.append(accuracy_regr)\n",
    "arraycuracy.append(accuracy_rf)\n",
    "arraycuracy.append(accuracy_gb)\n",
    "arraycuracy.append(accuracy_ab)\n",
    "arraycuracy.append(accuracy_vc)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 113,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "precisionray=[]\n",
    "precisionray.append(precision_regr)\n",
    "precisionray.append(precision_rf)\n",
    "precisionray.append(precision_gb)\n",
    "precisionray.append(precision_ab)\n",
    "precisionray.append(precision_vc)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 114,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "recallray=[]\n",
    "recallray.append(recall_regr)\n",
    "recallray.append(recall_rf)\n",
    "recallray.append(recall_gb)\n",
    "recallray.append(recall_ab)\n",
    "recallray.append(recall_vc)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 115,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "f1ray=[]\n",
    "f1ray.append(f1_regr)\n",
    "f1ray.append(f1_rf)\n",
    "f1ray.append(f1_gb)\n",
    "f1ray.append(f1_ab)\n",
    "f1ray.append(f1_vc)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 116,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAEJCAYAAAB7UTvrAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XucHFWZ//HPl5AAEeSWoJIEEyTIhkUQI95A40bWgGJg\nYSWggIhms8tFVBR2V9zssusPvKw3gjFcRBRFkYtRoiCsAgpIAgIhQDCGQBJu4W5QhJDn98c5Uyna\n7p6aZGo6M/m+X69+TdWpU9VPVVfVU3VOdY8iAjMzM4CNOh2AmZmtP5wUzMys4KRgZmYFJwUzMys4\nKZiZWcFJwczMCk4KA4ik6ZK+W+PyF0iakIcl6VuSnpR0s6R9JC2s6737C0krJe3Y6TjM1tbGnQ7A\nekbS4cAngF2APwK3Af8TEb+u+70jYtfS6N7AvsDIiHg2l7227hjWdxGxeadjqErS+cCyiPhMN/UE\n/AF4LiLG9UVs1jm+U+hHJH0C+ArwOeAVwA7ADOB9HQjn1cCSUkJYa5L6/cVJf1sHSYN6UP3twHbA\njpLeWFNITfW37TogRIRf/eAFbAmsBP6xTZ3pwHdL4xcDDwNPA9cBu5am7Q/cRbrbWA6clMuHAT8F\nngKeAK4HNsrTlgDvAo4BngNezDH9JzCBdNXZtfztgUuAFcB9wAkNcf4I+C7wDPCRJuuyGfAl4P4c\n/6+BzfK09wELcoy/Av6mNN8S4FPAHcCzwLmkBPqzvK5XA1vnuqOBAKYCDwIPdW2HPH0v4Mb8Pg8B\nZwJDStMDOBb4PXBfqWyndts4T/sosChv49nA9g3LnZaX+xQp8avJNtoU+DMwLI//O7AKeHkePw34\nSh4+H/gGMCdvl6nAC8Dz+TP8SZv96jzgQuBS4MyGadsA38rb70ng8tK0yaQ72WdIdxqTyvtRs/22\n9JkcAzwAXFdhX266rwBXAMc3xHsHcFCnj+f1+dXxAPyq+EHBpHzAb9ymTnFw5fEPA1sAm5DuMG4r\nTXsI2CcPbw3smYf/HzATGJxf+3SdkM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v7pdJOhCKp+2GNlTbEngo32UfQWoq\nolmizE+9bRQRlwCfYU3y7F11tEn1xxfpqnZZ6fUJ4NU072geS2orvAP4PLC8zXInUGq3zGWHktol\n7yA13XS1/08ltVH+ltSU8D9rsR6jye2Vefx8UgfwNaQmnw/l8iWs6UAeD/wqD5c7Vs+mWkdz4/sd\n0mxad9uG9h3NXTEMJp1o5+c4TsnlO+ft2ayjeXreBtcDlwAfJV1tjS/VmUy6Pb+F1CnZ7fZose3v\nITUb3Z3fq8cdzaT27pvz+sxnTb/W20ht5L9jHTuaB/orb7df5mHRvKN5MOn4vp3mHc0nlZZ3JzC6\n1f7UJo6xrDmH3EJqKi6Oizy9K1GeQe5HIV2Y3Jk/6+uBMaSLg1vzPn4bsF8d286/fbQWcrb/c0SE\npCmkTufG/yq3NsvdPCJW5juFy0g/InjZui53Q1farkNJV/5TI+LWTsdl/dNA35/6y/PZ65s3AGdK\nEvAU6cmk3jBd0rtI7dlXAZf30nI3dLPyl742JfXnDJgD2DpiQO9PvlPoJZJ2Iz2hVPaXiHhTJ+JZ\nn0g6GvhYQ/FvIuLYTsSzrnKn6jVNJk2MiMf7Oh7rPEkzKH3hL/tqRHyrE/GsCycFMzMr+OkjMzMr\nOCmYmVnBScHMzApOCmZmVvj/bQvwm0rQpTwAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x21f90fdd8d0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "#Lets compare Accuracy,precison,racall\n",
    "import matplotlib.pyplot as plt\n",
    "classifier_names=('Log_reg','random_forst','grad_boost','adaboost','voting_class')\n",
    "y_axis=np.arange(len(classifier_names))\n",
    "plt.bar(y_axis, arraycuracy, alpha=0.4,color='navy',ecolor='navy')\n",
    "plt.xticks(y_axis, classifier_names)\n",
    "plt.ylabel('Accuracy Scores')\n",
    "plt.title('Classifier comparison wrt Accuracy')\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 117,
   "metadata": {
    "collapsed": false,
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAEJCAYAAAB7UTvrAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xu4HWV59/HvzxAIkZOSYCUkJECAwgtB2JxUalq0JioC\nlZaAh0rVvGmlYD1BW2tjsa14ej0AphFCpFBpqYIRUkGoAsopB0NCgGAMwSQghrPhlITc7x/PsyfD\nYq21Zyd79spOfp/rWteaw7OeuWfWrLlnnpk1o4jAzMwM4FWdDsDMzLYcTgpmZlZwUjAzs4KTgpmZ\nFZwUzMys4KRgZmYFJ4WtiKSpki6vsf7Fksbnbkm6VNKTku6SdJykJXVNe6CQtEbSPp2OY6Cpsty8\njvWP7TodgPWOpNOBjwMHAr8DFgD/HBE/q3vaEXFwqffNwNuAvSLi2TzsgLpj2NJFxE6djqEqSTOB\nlRHxmTZlAngOCOBp4D+BT0XES30ZS5XlFhG34nWsdj5SGEAkfRz4GvAvwOuAUcCFwLs7EM7ewPJS\nQthkkgb8zslAmwdJg3pRfFzeaB8PnA58pEl9A2r+rY2I8GsAvIBdgTXAn7YpMxW4vNR/FfAb0h7e\nLcDBpXHvAO4lHW2sAj6Zhw8DrgWeAp4AbgVelcctB94KfAh4AXgpx/Q5YDxpr7O7/j2B7wGrgQeB\nsxri/G/gcuAZ4MNN5mVH4CvAQzn+nwE75nHvBhbnGH8K/H7pc8uBTwELgWeBS0gJ9H/yvN4IvCaX\nHU3aA54MPAw80r0c8vijgNvzdB4BLgC2L40P4KPAL4EHS8P2a7eM87iPAEvzMp4F7NlQ75Rc71Ok\nxK8my2gI8DwwLPf/PbAe2CX3nwd8LXfPBL4FzM7LZTKwDlibv8MftlinivkprVMXlJb1OXlZv0hq\neWj3vQ8C/g74VV4m84CRVZcbr1zHfj9//0/l9eHdpXEz83K7LtdzJ7Bvp3/HA+HV8QD8qvhF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BLwKr2tQ7nlK7ZR52KqldciGp6aa7/X8yqY3yTlJTwj9vwnyMJrdX\n5v6ZpBPAN5GafD6Yhy9n4wnkLuCnubt8YvXbVDvR3Di9U5qN62nZ0P5Ec3cMg0kb2kU5jnPz8P3z\n8mx2onlqXga3At8DPkLa2+oqlTmRdHg+j3RSssfl0WLZ309qNrovT6vXJ5pJ7d135flZxMbzWm8i\ntZH/gs080by1v/Jy+0nuFs1PNA8m/b7vpvmJ5k+W6rsHGN1qfWoTx1g2bkPmkZqKi99FHt+dKM8n\nn0ch7Zjck7/rW4ExpJ2D+XkdXwBMrGPZ+d5HmyBn++cjIiRNIp10bnyq3KbUu1NErMlHCleTbiJ4\n9ebWu60rLdehpD3/yRExv9Nx2cC0ta9PA+X67C3NEcAFkgQ8RboyqS9MlfRWUnv2DcA1fVTvtm56\n/tPXENL5nK3mB2wdsVWvTz5S6COSDiFdoVT2YkQ0PoJ0myPpDODshsE/j4iPdiKezZVPqt7UZNTx\nEfF4f8djnSfpQkp/+Mu+HhGXdiKezeGkYGZmBV99ZGZmBScFMzMrOCmYmVnBScHMzAr/H8/WKzTT\nbfW0AAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x21f92a26400>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "y_axis=np.arange(len(classifier_names))\n",
    "plt.bar(y_axis,precisionray, alpha=0.4,color='purple',ecolor='darkgreen')\n",
    "plt.xticks(y_axis, classifier_names)\n",
    "plt.ylabel('Precision Scores')\n",
    "plt.title('Classifier comparison wrt Precision')\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 118,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAEJCAYAAAB7UTvrAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xm8HFWd9/HPl0s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Rj2/qeKz1JE2j9IG/7N8i4vJWxNMbTgpm\nZlbw3UdmZlZwUjAzs4KTgpmZFZwUzMys8P8BJlX67L5/ar0AAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x21f92ab56d8>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "y_axis=np.arange(len(classifier_names))\n",
    "plt.bar(y_axis,recallray, alpha=0.4,color='brown',ecolor='black')\n",
    "plt.xticks(y_axis, classifier_names)\n",
    "plt.ylabel('recall Scores')\n",
    "plt.title('Classifier comparison wrt Recall')\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 119,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAEJCAYAAAB7UTvrAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAH8VJREFUeJzt3Xu8FXW9//HX2y2IF/LG1pMggkUZ/ry2JU396TlmgWlo\nWqKlpRnRyWNlVp7T5UfXo8f6/TomRmjE6XKyrDQyCsuTl7xxUQRRMUIMSA3v4h35/P74fvcwLNda\newF79ubyfj4e67FnvvNd3/nM7FnzWfOdWTOKCMzMzAC26O0AzMxsw+GkYGZmBScFMzMrOCmYmVnB\nScHMzApOCmZmVnBSsKYkjZf0owrbny/pyDwsSd+X9ISkGZIOl7SgqnlvLCStkLRnb8fRXSQdKunP\nebmO7+14bE1OCoakUyXNyh/ShyT9VtJhPTHviNg7Iq7Po4cBRwODImJERNwUEW/siTg2ZBGxXUQs\n6u04WiFpiqSvdlHty8AlebmulvReSbdIek7S9T0QpjXhpLCZk3Qu8C3g68CuwGBgAvCuXghnD2Bx\nRDy7vg1J2rIb4ulVG9sySGprseoewPzS+OOkbfCCbg/K1l5E+LWZvoDtgRXAe5rUGQ/8qDR+JfAw\n8BRwI7B3adoxwD3AM8Ay4LxcPgC4BniStAO4CdgiT1sM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kn3yTNIrUrQJp\n2Y+XtI2kbYETWL0+usMCYIik1+fx00jf6NaQT5zvHhF/BD5L2mFtBzxDOsSudTNwXN5xbUfaydbT\naMfXaH00MljSIXn4VFK/c6Nlq1ue49w+IqaRdhr75emNlnFt/Q7YUtK9pD7420i3qx8P3EpaZ/eW\n6o8HrpQ0m1ffHnou8Mfcxlci4m/AVbn8LtI5uc9ExMNNyo8E7pJ0J2lH/p+57UnA3HU40fxT0ufy\nJFKCaJSk1mV9tro9kb/dL5V0PBRX221TU2174KF8lH0aqauIeokyX/W2RUT8Avg8q5Nn96qiT2pj\nfJG+1S4tvc4l3X+83onmYaS+wrnAfwDLmrR7JKV+y1x2Mqlfci6p66az/38sqY/ydlJXwtfWYTmG\nkPsr8/gU0gng60hdPh/M5YtZfQK5A7g+D5dPrF5Gayeaa+d3Ur1pXa0bmp9o7oyhD2lHOy/HcX4u\nf0Nen/VONI/P6+Am4BfAh0nftjpKdUaTDs9nk05Kdrk+Gqz7+0jdRvfmea31iWZSf/eMvDzzWH1e\n61BSH/mdrOeJ5k39ldfbH/OwqH+iuQ/p830X9U80n1dq725gSKPtqUkcw1i9D5lN6iouPhd5emei\nvJB8HoX0xeTu/L++CRhK+nJwR97G5wCjqlh3vvfROsjZ/vmICEljSCeda58qty7tbhcRK/KRwlWk\nmwhetb7tbu5K63Ub0jf/sRFxR2/HZRunTX172liuz97QvBm4RJKAJ0lXJnWH8ZLeRurPvha4upva\n3dxNyj/66kc6n7PJfICtV2zS25OPFLqJpH1IVyiVvRgRtY8g3exIOgP4eE3xzRHxsd6IZ33lk6rX\n1Zl0VEQ81tPxWO+TNIHSD/6y/4yI7/dGPOvDScHMzAq++sjMzApOCmZmVnBSMDOzgpOCmZkV/j/V\nIXXqDGg0xgAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x21f92b3ba58>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "y_axis=np.arange(len(classifier_names))\n",
    "plt.bar(y_axis,f1ray, alpha=0.6,color='orange',ecolor='black')\n",
    "plt.xticks(y_axis, classifier_names)\n",
    "plt.ylabel('f1 Scores')\n",
    "plt.title('Classifier comparison wrt f1')\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 120,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Best parameters for Adaboost: {'n_estimators': 15}\n"
     ]
    }
   ],
   "source": [
    "#Some fine REFINEMENTS to GBboost,Rfforest,and Adaboost\n",
    "#PERFROM GRIDSEARCH CV on RF,GB and Adaboost to find best parameter values on 10 fold cross validation set\n",
    "from sklearn.metrics import classification_report\n",
    "from sklearn.grid_search import GridSearchCV\n",
    "from sklearn.metrics import make_scorer\n",
    "from sklearn.metrics import fbeta_score\n",
    "from sklearn.ensemble import RandomForestClassifier\n",
    "from sklearn.ensemble import AdaBoostClassifier\n",
    "\n",
    "\n",
    "parameters_ada ={'n_estimators' :[15,25,50],\n",
    "            }\n",
    "\n",
    "\n",
    "\n",
    "clf = GridSearchCV(AdaBoostClassifier(random_state=10), parameters_ada,cv=10,scoring='accuracy')\n",
    "clf.fit(X_train, y_train)\n",
    "print(\"Best parameters for Adaboost:\",clf.best_params_)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 121,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Best parameters for GradeintBoosting: {'min_samples_split': 15, 'n_estimators': 50}\n",
      "Best parameters for RandomForest: {'min_samples_split': 15, 'n_estimators': 50}\n"
     ]
    }
   ],
   "source": [
    "parameters_boost ={'n_estimators' :[15,25,50],\n",
    "             'min_samples_split' :[3,10,15]\n",
    "}\n",
    "\n",
    "clf00 = GridSearchCV(GradientBoostingClassifier(random_state=10), cv=10, param_grid=parameters_boost, scoring='accuracy')\n",
    "clf00.fit(X_train,y_train)\n",
    "print(\"Best parameters for GradeintBoosting:\",clf00.best_params_)\n",
    "\n",
    "\n",
    "clf001 = GridSearchCV(RandomForestClassifier(random_state=10), cv=10, param_grid=parameters_boost,scoring='accuracy')\n",
    "clf001.fit(X_train,y_train)\n",
    "print(\"Best parameters for RandomForest:\",clf001.best_params_)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 195,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "#Use the above parameter values for our Weighted voting CLassifier\n",
    "\n",
    "#First we have to calibrate our classsifers\n",
    "\n",
    "#Isotonic claibration\n",
    "from sklearn.calibration import CalibratedClassifierCV\n",
    "clfvc1 = RandomForestClassifier(n_estimators=50,min_samples_split=15,random_state=10)\n",
    "clfvc2=AdaBoostClassifier(n_estimators=15,random_state=10)\n",
    "clfvc3=GradientBoostingClassifier(n_estimators=50,min_samples_split=15,random_state=10)\n",
    "clf_isotonic1 = CalibratedClassifierCV(clfvc1, method='isotonic',cv=10)\n",
    "clf_isotonic2 = CalibratedClassifierCV(clfvc2, method='isotonic',cv=10)\n",
    "clf_isotonic3 = CalibratedClassifierCV(clfvc3, method='isotonic',cv=10)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 185,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "VotingClassifier(estimators=[('rf', CalibratedClassifierCV(base_estimator=RandomForestClassifier(bootstrap=True, class_weight=None, criterion='gini',\n",
       "            max_depth=None, max_features='auto', max_leaf_nodes=None,\n",
       "            min_impurity_decrease=0.0, min_impurity_split=None,\n",
       "            min_samples_leaf=1, m..., subsample=1.0, verbose=0,\n",
       "              warm_start=False),\n",
       "            cv=10, method='isotonic'))],\n",
       "         flatten_transform=None, n_jobs=1, voting='soft',\n",
       "         weights=[1, 1, 1])"
      ]
     },
     "execution_count": 185,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#Inputing the istonic calibration to voting classifier with weights.\n",
    "import time\n",
    "t0 = time.clock()\n",
    "clfvc = VotingClassifier(estimators=[('rf',clf_isotonic1),('ab', clf_isotonic2),('gb',clf_isotonic3)],voting='soft',weights=[1,1,2])\n",
    "clfvc.fit(X_train,y_train)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 186,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "y_predvc = clfvc.predict(X_test)\n",
    "accuracy_vciso=accuracy_score(y_test, y_predvc)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 187,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "precision_vciso=precision_score(y_test, y_predvc)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 188,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "accuracy: 0.821666666667\n",
      "Precision: 0.805790548828\n",
      "Recall: 0.821666666667\n",
      "f1_score: 0.800497169577\n",
      "Training_time: 59.46775733333334\n"
     ]
    }
   ],
   "source": [
    "#Results of weighted voting classifer\n",
    "y_predvc = clfvc.predict(X_test)\n",
    "accuracy_vciso=accuracy_score(y_test, y_predvc)\n",
    "precision_vciso=precision_score(y_test, y_predvc,average='weighted')\n",
    "recall_vciso=recall_score(y_test, y_predvc,average='weighted')\n",
    "f1_vciso=f1_score(y_test,y_predvc,average='weighted')\n",
    "print(\"accuracy:\", accuracy_vciso)\n",
    "print(\"Precision:\", precision_vciso)\n",
    "print(\"Recall:\", recall_vciso)\n",
    "print('f1_score:',f1_vciso)\n",
    "print('Training_time:',time.clock() - t0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 193,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "GradientBoostingClassifier(criterion='friedman_mse', init=None,\n",
       "              learning_rate=0.1, loss='deviance', max_depth=3,\n",
       "              max_features=None, max_leaf_nodes=None,\n",
       "              min_impurity_decrease=0.0, min_impurity_split=None,\n",
       "              min_samples_leaf=1, min_samples_split=15,\n",
       "              min_weight_fraction_leaf=0.0, n_estimators=50,\n",
       "              presort='auto', random_state=10, subsample=1.0, verbose=0,\n",
       "              warm_start=False)"
      ]
     },
     "execution_count": 193,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#Training just the Gradient Boost(clfvc3) with tuned parameters from above\n",
    "t1 = time.clock()\n",
    "clfvc3.fit(X_train,y_train)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 194,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "accuracy: 0.822888888889\n",
      "Precision: 0.807469736307\n",
      "Recall: 0.822888888889\n",
      "f1_score: 0.801832784112\n",
      "Training_time: 1.9779253333335873\n"
     ]
    }
   ],
   "source": [
    "#results of Tuned Gradient Boosting classifer\n",
    "y_predgb2 = clfvc3.predict(X_test)\n",
    "accuracy_gb2=accuracy_score(y_test, y_predgb2)\n",
    "precision_gb2=precision_score(y_test, y_predgb2,average='weighted')\n",
    "recall_gb2=recall_score(y_test, y_predgb2,average='weighted')\n",
    "f1_gb2=f1_score(y_test,y_predgb2,average='weighted')\n",
    "print(\"accuracy:\", accuracy_gb2)\n",
    "print(\"Precision:\", precision_gb2)\n",
    "print(\"Recall:\", recall_gb2)\n",
    "print('f1_score:',f1_gb2)\n",
    "print('Training_time:',time.clock() - t1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 196,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.82220287299291184"
      ]
     },
     "execution_count": 196,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#FINAL EVALUATION USING Stratified 10-fold CV on VC\n",
    "from sklearn.model_selection import cross_val_score\n",
    "#accuracy\n",
    "scores = cross_val_score(clfvc3, credit.drop('default.payment.next.month',axis=1), credit['default.payment.next.month'],cv=10)\n",
    "scores.mean()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 197,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.80021882447113324"
      ]
     },
     "execution_count": 197,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from sklearn.model_selection import cross_val_score\n",
    "#f1\n",
    "scores1 = cross_val_score(clfvc3, credit.drop('default.payment.next.month',axis=1), credit['default.payment.next.month'],cv=10,scoring='f1_weighted')\n",
    "scores1.mean()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 198,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.80645997468495467"
      ]
     },
     "execution_count": 198,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#Precision\n",
    "scores2 = cross_val_score(clfvc3, credit.drop('default.payment.next.month',axis=1), credit['default.payment.next.month'],cv=10,scoring='precision_weighted')\n",
    "scores2.mean()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 199,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.82220287299291184"
      ]
     },
     "execution_count": 199,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#Recall\n",
    "scores3 = cross_val_score(clfvc3, credit.drop('default.payment.next.month',axis=1), credit['default.payment.next.month'],cv=10,scoring='recall_weighted')\n",
    "scores3.mean()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 200,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Accuracy: 0.822202872993\n",
      "Precision: 0.806459974685\n",
      "Recall: 0.822202872993\n",
      "F1: 0.800218824471\n"
     ]
    }
   ],
   "source": [
    "#corss validated final results of tuned Gradient Boosting\n",
    "print(\"Accuracy:\",scores.mean())\n",
    "print(\"Precision:\",scores2.mean())\n",
    "print(\"Recall:\",scores3.mean())\n",
    "print(\"F1:\",scores1.mean())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 260,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.68193712829259523"
      ]
     },
     "execution_count": 260,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#lets crossvalidate log regression \n",
    "#f1\n",
    "import warnings\n",
    "warnings.filterwarnings(\"ignore\")\n",
    "scores4 = cross_val_score(LogisticRegression(C=0.8,random_state=10), credit.drop('default.payment.next.month',axis=1), credit['default.payment.next.month'],cv=10,scoring='f1_weighted')\n",
    "scores4.mean()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 261,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.77876670255926317"
      ]
     },
     "execution_count": 261,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#accuracy\n",
    "scores5 = cross_val_score(LogisticRegression(C=0.8,random_state=10), credit.drop('default.payment.next.month',axis=1), credit['default.payment.next.month'],cv=10)\n",
    "scores5.mean()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 262,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.60652374650316576"
      ]
     },
     "execution_count": 262,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#precision \n",
    "scores6 = cross_val_score(LogisticRegression(C=0.8,random_state=10), credit.drop('default.payment.next.month',axis=1), credit['default.payment.next.month'],cv=10,scoring='precision_weighted')\n",
    "scores6.mean()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 263,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.77876670255926317"
      ]
     },
     "execution_count": 263,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#Recall\n",
    "scores7 = cross_val_score(LogisticRegression(C=0.8,random_state=10), credit.drop('default.payment.next.month',axis=1), credit['default.payment.next.month'],cv=10,scoring='recall_weighted')\n",
    "scores7.mean()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 264,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Accuracy: 0.778766702559\n",
      "Precision: 0.606523746503\n",
      "Recall: 0.778766702559\n",
      "F1: 0.681937128293\n"
     ]
    }
   ],
   "source": [
    "print(\"Accuracy:\",scores5.mean())\n",
    "print(\"Precision:\",scores6.mean())\n",
    "print(\"Recall:\",scores7.mean())\n",
    "print(\"F1:\",scores4.mean())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 254,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAecAAAFJCAYAAAChG+XKAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAGfNJREFUeJzt3W1QVOfdx/EfuysP2wUDEW0zKhUi1jhGhmnHZBrSpJUG\nNGlFEpbFYExyO05q61jRO+oYo2gYiiY2NlEbtKTFStA2o2jGzohibJlpOqXBSI3a2MRRaxUjkaeZ\nrMvu/SK32xLR9QE4F/D9vGL3cJb/AQ5frhXPhgUCgYAAAIAxbFYPAAAAOiPOAAAYhjgDAGAY4gwA\ngGGIMwAAhiHOAAAYxmH1AFc0NrZYPQIAAL0mPj76mttYOQMAYBjiDACAYYgzAACGIc4AABiGOAMA\nYBjiDACAYYgzAACGIc4AABiGOAMAYBjiDACAYYgzAACGMeba2qZat26NDh8+ZPUYGj9+gubOXWD1\nGECvMeXckzj/0PtYOQMAYJiwQCAQsHoIqX+/KtWsWfmSpNLScosnAQYWzj2YjFelAgCgDyHOAAAY\nhjgDAGAY4gwAgGGIMwAAhiHOAAAYhjgDAGAY4gwAgGGIMwAAhiHOAAAYhjgDAGAY4gwAgGGIMwAA\nhiHOAAAYhjgDAGAY4gwAgGGIMwAAhiHOAAAYhjgDAGAY4gwAgGGIMwAAhiHOAAAYxhHqHfx+v5Yv\nX65jx44pPDxcq1atUkJCQnB7VVWVysrKZLPZlJ2drby8PHV0dGjp0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qqkrZ\n2dn61a9+pc2bN2vbtm2qra1VRESEPvnkE0nSG2+8ob1792ro0KFX3RceHq7GxkZJ0pEjR4KPa7P9\n51P+wgsvqKioSMXFxRo6dKgCgYASExN15MgR+f1+Xb58WU8//bS8Xq9ycnK0fft2ffrpp/rGN77R\na5+H/iYsLEySlJiYqClTpqi8vFylpaXKyMjQ0KFD1dzcrM8++0yStGrVqmC8JamyslI/+clPtGXL\nFknS3r17g9uSkpKCT2lfvnxZ77//vhISEjp9THSv2NhYrV69WkuXLtWQIUM0ceJElZeX69e//rUy\nMzM1YsSILs/Nrs47wDSsnK9h+/btKikpCd6OiorS97//fQ0ZMkRLliyRzWZTfHy8Zs6cqWHDhl11\nX3h4uFasWKG77rpLQ4cO7fJj/OAHP9D06dMVFRWlIUOG6Pz58xo7dqzS0tLk8Xjk9/vl8XgUHh6u\nCRMm6OTJk5o+fXpvfQr6tdzcXC1dulRPPvmkWltblZeXJ5vNphdffFGzZ8+WzWbTPffco/Hjxwf3\nuffeezV79mx95StfkdPp1EMPPRQM9cMPP6y//OUvcrvdunz5sjIyMvi35V5w9913Kz8/XzU1Nfra\n176mvLw8tbe3a9KkSXK5XFqxYsVV52ZX5x1gGq6t3UdcCfXmzZs7vb42AKD/4WntPuDUqVPKysrS\n5MmTCTMADACsnAEAMAwrZwAADEOcAQAwDHEGAMAwxBkAAMMQZwAADEOcAQAwzP8BIV46jfHdLmgA\nAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x21f919a60b8>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "#Free form visualization of all metrics of Gradient boosting(final model) and Log_regression(benchmark model)\n",
    "import seaborn as sns\n",
    "all_scores=[]\n",
    "all_scores.append(scores)\n",
    "all_scores.append(scores2)\n",
    "all_scores.append(scores3)\n",
    "all_scores.append(scores1)\n",
    "eval1=[]\n",
    "eval1.append('Accuracy')\n",
    "eval1.append('Precision')\n",
    "eval1.append('Recall')\n",
    "eval1.append('F1')\n",
    "ax=sns.boxplot(y=all_scores,x=eval1,palette=(\"RdBu_r\"),linewidth=2.0,width=0.6)\n",
    "#ax.set(ylim=(0.76, 0.82))"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
